include lib/lib.mk

PATH:=$(PATH):./src

demos :
	@grep '^eg' Makefile | gawk '{print $$1}'

egGawk4 : ready
	$A $(Watch) -f src/small.awk $Z

eg000 : ready 
	$A $(Demo)=d1  $Z

############################################################
eg001 : ready  data/autoMpg.arff
	$A $(Watch) -f src/where2.awk --source 'END{_cprint()}' data/autoMpg.arff $Z

eg002 : ready data/weather.arff
	$A $(Run) -f src/where2.awk --source 'END{_cprint()}' TooSmall=2 data/weather.arff $Z

eg003 : ready data/letter.arff
	$A $(Run) -f src/where2.awk --source 'END{_cprint()}' TooSmall=200 data/letter.arff $Z

############################################################
egReadwnom : ready data/weather.nominal.arff
	$A $(Run) -f src/readarff.awk --source 'END{readArffDump()}' data/weather.nominal.arff $Z	

egReadArff2 : ready data/autoMpg.arff
	$A $(Watch) -f src/readarff.awk data/autoMpg.arff  $Z	

egReadArff3 : ready data/letter.arff
	time $A $(Watch) -f src/readarff.awk data/letter.arff $Z

##############################################################

learn  :
	$A randarff data/$X.arff | $(Learner) Relation=$X | abcd | malign

learn10  :
	@$(MAKE) learn; $(MAKE) learn; $(MAKE) learn;
	@$(MAKE) learn; $(MAKE) learn; $(MAKE) learn;
	@$(MAKE) learn; $(MAKE) learn; $(MAKE) learn;
	@$(MAKE) learn;

##############################################################

nb   : data/$X.arff ready ; @$(MAKE) Learner=nb learn10

egnbwNom      : ; @$(MAKE) nb X=weather.nominal
egnbwNom3     : ; @$(MAKE) nb X=weather3.nominal
egnbWine      : ; @$(MAKE) nb X=wine 
egnbSoybean   : ; @$(MAKE) nb X=soybean 
egnbCredit    : ; @$(MAKE) nb X=credit 
egnbDiabetes  : ; @$(MAKE) nb X=diabetes 
egnbAnneal    : ; @$(MAKE) nb X=anneal 
egnbAudiology : ; @$(MAKE) nb X=audiology 
egnbLetter    : ; @$(MAKE) nb X=letter
egnbLetterX   : ; @$(MAKE) nb X=letterx # all ints treated as symbols
